# 主窗口日志输出中继台


class MyPrint:
    def __init__(self):
        self.log_signal = None
        self.to_end_signal = None
        self.start_signal = None
        self.end_signal = None
        self.add_list_signal = None

    def set_signal(self, log_signal, to_end_signal, start_signal, end_signal, add_list_signal):
        """设置主窗口日志信号"""
        self.log_signal = log_signal
        self.to_end_signal = to_end_signal
        self.start_signal = start_signal
        self.end_signal = end_signal
        self.add_list_signal = add_list_signal

    def print(self, ms, level=0):
        """tab1 主窗口日志信号发射器"""
        self.log_signal.emit(ms, level)

    def to_end(self):
        """tab1 主窗口日志滚动到底部信号发射器"""
        self.to_end_signal.emit()

    def start(self):
        """tab1 开始执行任务信号发射器"""
        self.start_signal.emit()

    def end(self):
        """tab1 结束执行任务信号发射器"""
        self.end_signal.emit()

    def add_list(self):
        """tab1 添加列表数据信号发射器"""
        self.add_list_signal.emit()
